package com.feiclub.subject.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ResultCodeENUM {
    SUCCESS(200,"成功"),
    FAIL(500,"失败");

    private int code;
    private String desc;


    public static ResultCodeENUM getByCode(int codeVal){
        for (ResultCodeENUM resultCodeENUM : ResultCodeENUM.values()) {
            if (resultCodeENUM.code == codeVal){
                return resultCodeENUM;
            }
        }
        return null;
    }
}
